ABOUTDEVELOPERS |
SpatialStream® Code Examples
Color Change
This example shows how the color of the parcel lines can be modified when using the Parcel Tile layer. To change the default color of the lines, add the "color" parameter and define your desired parcel line color. In the sample, the color is changed using a color picker box. GetMap
var sourceUrl = Dmp.Env.Connections["SS"].getBaseUrl() + "GetMap.aspx?layers=Dmp_License/ParcelTiles&tileid=%4";
sourceUrl = Dmp.Env.Connections["SS"].finalizeUrl(sourceUrl); tileSourceSpec = new VETileSourceSpecification("Parcels", sourceUrl); map.AddTileLayer(tileSourceSpec, true); //---------------- function setColor(color) { color = RGBtoHex(color); var sourceUrl = Dmp.Env.Connections["SS"].getBaseUrl() + "GetMap.aspx?layers=Dmp_License/ParcelTiles&color=" + encodeURI(color.substring(1)) + "&tileid=%4" sourceUrl = Dmp.Env.Connections["SS"].finalizeUrl(sourceUrl); tileSourceSpec = new VETileSourceSpecification("Parcels", sourceUrl); map.DeleteTileLayer("Parcels"); map.AddTileLayer(tileSourceSpec, document.getElementById('ParcelToggle').checked); //hide/show the layer depending on toggle Run Sample Back To Index |